home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 April / Chip CMCD0400.iso / SOFTWARE / Demo / InfoPulse / GateKeeper / gk3full.exe / data1.cab / ConfigSite_Files / rules / protocoledit.agp < prev    next >
Encoding:
Text File  |  1999-06-17  |  4.7 KB  |  194 lines

  1. <%
  2.    lArgs = "xx"
  3.  
  4.    On Error Resume Next
  5.    nou = False
  6.    ruleName = Request.ReqParam("rule")
  7.    Set rule = Rules.item(ruleName)
  8.    protName = Request.ReqParam("protocol")
  9.    
  10.    if protName = "" then
  11.     nou = True
  12.    else
  13.     action = Request.ReqParam("action")
  14.     if action = "Commit" then
  15.         nou = Request.ReqParam("nou")
  16.         if( nou ) then
  17.             rule.AddProtocol(protName)
  18.             rule.Commit
  19.             Response.Redirect( "/rules/protocoledit.agp?rule=" & ruleName & "&protocol=" & protName)
  20.         end if
  21.         chkBoxes = Request.ReqParam("cb")
  22.         for i = 1 to 7
  23.             for j = 0 to 23
  24.                 rule.SetPermission protName, i, j, True
  25.             next
  26.         next
  27.         if( chkBoxes <> ""  ) then
  28.             while ( chkBoxes <> "" )
  29.                 aBox = Mid(chkBoxes,1,3)
  30.                 chkBoxes = Mid(chkBoxes,5)
  31.                 sI = Mid(aBox,1,1)
  32.                 sJ = Mid(aBox,2,2)
  33.                 rule.SetPermission protName, sI, sJ, False
  34.             wend
  35.             rule.Commit
  36.             Response.Redirect( "/rules/rule.agp?rule=" & ruleName )
  37.         end if
  38.     end if
  39.     if action = "Remove" then
  40.         rule.DelProtocol(protName)
  41.         rule.Commit
  42.         Response.Redirect( "/rules/rule.agp?rule=" & ruleName )
  43.     end if
  44.    end if
  45. %>
  46. <html>
  47. <head>
  48. <meta NAME="Author,Design" Content="GateKeeper Team; gatekeeper@infopulse.net">
  49. <meta NAME="Copyright" Content="Infopulse; www.infopulse.net">
  50. <title>Empty</title>
  51. </head>
  52.  
  53. <body bgcolor="#FFFFFF" text="#000000">
  54. <%
  55.    if nou then
  56. %>
  57.     <p><big><strong><font face="Arial">Select the protocol you want to add the rule for</font></strong></big></p>
  58. <%
  59.    else
  60. %>
  61.     <p><big><strong><font face="Arial">Edit <%Response.Write(protName)%> protocol time schedule for <%Response.Write(ruleName)%></font></strong></big></p>
  62.     <font face="Arial">
  63.         <strong>Note:</strong>0 means hour 0.00.00 - 0.59.59, checked means DENIED
  64.     </font>
  65. <%
  66.    end if
  67.    if Not Err.Number = 0 Then
  68.     Response.Write("<B><FONT COLOR=""#FF0000"">" & Err.Description & ": " & ruleName & "</FONT></B><br>")
  69.    end if
  70. %>
  71.  
  72. <form method="POST" action= "/rules/protocoledit.agp?rule=<%Response.Write(ruleName)%>">
  73.  
  74. <%
  75.    if nou then
  76. %>
  77.     <div>
  78.     <table border="1" cellpadding="0" cellspacing="0" width="60%">
  79.         <tr>
  80.             <td width="20%" bgcolor="#183159"><strong><font face="Arial" color="#FFFFFF">
  81.                 Option
  82.             </font></strong></td>
  83.             <td width="40%" bgcolor="#183159"><strong><font face="Arial" color="#FFFFFF">
  84.                 Value
  85.             </font></strong></td>
  86.         <tr>
  87.         <tr>
  88.             <td width="50%"><strong><font face="Arial">
  89.                 Protocol
  90.             </font></strong></td>
  91.             <td width="50%">
  92.                 <select name="protocol" size="1">
  93. <%
  94.                     Set proxy = Proxies.NewProxy
  95.                     proxy.GetFirstDLL sFile, sType, sVersion, sName
  96.                     Response.Write("<option value=""" & sType & """>" & sType & "</option>")
  97.  
  98.                     proxy.GetNextDLL sFile, sType, sVersion, sName
  99.                     while Len(sFile)
  100.                         Response.Write("<option value=""" & sType & """>" & sType & "</option>")
  101.                            proxy.GetNextDLL sFile, sType, sVersion, sName
  102.                     wend
  103. %>
  104.                 </select>
  105.             </td>
  106.            </tr>
  107.     </table></div>
  108. <%
  109.    else
  110. ' procedure for checking rights
  111. Sub IsChecked( nume, zi, ora )
  112.     if(rule.GetPermission( nume, zi, ora ) = False ) then
  113.         Response.Write(" checked")
  114.     end if
  115. end sub
  116. %>
  117.  
  118.     <input type="hidden" name="protocol" value="<%Response.Write(protName)%>"></td>
  119.     <input type="hidden" name="nou" value="<%Response.Write(nou)%>"></td>
  120.  
  121.     <div align="center"><center>
  122.     <table border="1" cellpadding="0" cellspacing="0" width="100%">
  123.         <tr>
  124.             <td bgcolor="#183159"><strong><font face="Arial" color="#FFFFFF">
  125.                  
  126.             </font></strong></td>
  127.             <%
  128.                 for i = 0 to 23
  129.             %>
  130.             <td bgcolor="#183159" align="center"><strong><font face="Arial" color="#FFFFFF">
  131.                 <%Response.Write(i)%>
  132.             </font></strong></td>
  133.             <%
  134.                 next
  135.             %>
  136.            </tr>
  137. <%
  138.     Sub WriteDay( nr )
  139.         Select case nr
  140.             Case 1
  141.                 Response.Write("Sunday")
  142.             Case 2
  143.                 Response.Write("Monday")
  144.             Case 3
  145.                 Response.Write("Tuesday")
  146.             Case 4
  147.                 Response.Write("Wednesday")
  148.             Case 5
  149.                 Response.Write("Thursday")
  150.             Case 6
  151.                 Response.Write("Friday")
  152.             Case 7
  153.                 Response.Write("Saturday")
  154.         End Select
  155.     End Sub
  156. %>
  157.         <%
  158.             for i = 1 to 7
  159.         %> 
  160.             <tr>
  161.                 <td><strong><font face="Arial">
  162.                     <%WriteDay(i)%>
  163.                 </font></strong></td>
  164.                 <%
  165.                     for j = 0 to 23
  166.                 %>
  167.                 <td width="50">
  168.                     <input type="checkbox" name="cb" value="<%Response.Write(i*100+j)%>" <% IsChecked protName,i,j %>>
  169.                 </td>
  170.                 <%
  171.                     next
  172.                 %>
  173.                </tr>
  174.         <%
  175.            next
  176.         %>
  177.     </table></center></div>
  178. <%
  179.    end if
  180. %>
  181. <br>
  182.     <input type="submit" name="action" value="Commit">
  183. <%
  184.    if Not nou then
  185. %>
  186.     <input type="submit" name="action" value="Remove">
  187. <%
  188.    end if
  189. %>
  190. </form>
  191. <font size="1" face="Arial"><%Response.Write(GateKeeper.Version)%></font>
  192. </body>
  193. </html>
  194.